from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import DeliveryAreaViewSet, DeliverymanAreaViewSet, DeliveryTaskViewSet, DeliveryStatusRecordViewSet, delivery_staff

router = DefaultRouter()
router.register(r'delivery-areas', DeliveryAreaViewSet)
router.register(r'deliveryman-areas', DeliverymanAreaViewSet)
router.register(r'delivery-tasks', DeliveryTaskViewSet)
router.register(r'delivery-status-records', DeliveryStatusRecordViewSet)

urlpatterns = [
    path('', include(router.urls)),
    path('delivery-tasks/<int:pk>/assign/', DeliveryTaskViewSet.as_view({'post': 'assign'}), name='delivery-task-assign'),
    path('delivery-tasks/<int:pk>/status/', DeliveryTaskViewSet.as_view({'post': 'status'}), name='delivery-task-status'),
    path('delivery-tasks/<int:pk>/reject/', DeliveryTaskViewSet.as_view({'post': 'reject'}), name='delivery-task-reject'),
    path('delivery-staff/', delivery_staff, name='delivery-staff'),
]